package com.derbysoft.dswitch.adapter.ihg.common.domain;


public enum ResponseStatus {

    SUCCESS("success"), ERROR("error");

    private String description;

    private ResponseStatus(String description) {
        this.description = description;
    }

    public String getDescription() {
        return description;
    }

    public static ResponseStatus fromRequest(String response) {
        if (response.contains("Errors") && response.contains("ShortText")) {
            return ERROR;
        }
        return SUCCESS;
    }
}
